package com.itheima.springboottlias.controller;


import Pojo.JobCountItem;
import Pojo.Result;
import com.itheima.springboottlias.service.impl.ReportServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportServiceImpl reportService;
    //  员工职位统计报表
    @GetMapping("/empJobData")
    public Result empJobCount() {
        //1.请求参数：无
        //2.调用业务层方法，完成查询
        Map map = reportService.empJobCount();
        return Result.success(map);
    }
    //员工性别统计
    @GetMapping("/empGenderData")
    public Result empGenderCount(){

       List<Map> map=reportService.empGenderCount();

        return Result.success(map);

    }
    //学员学历统计
    @GetMapping("/studentDegreeData")
    public Result stuDegreeCount(){
        List<JobCountItem> stuDegree=reportService.stuDegreeCount();

        return Result.success(stuDegree);

    }
    //班级学员数量统计
    @GetMapping("/studentCountData")
    public Result stuClassCount(){
        Map map=reportService.stuClassCount();

        return Result.success(map);

    }



}
